package org.orcean.com.manager.order.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.orcean.com.common.response.ResultVo;
import org.orcean.com.manager.order.entity.Order;
import org.springframework.web.bind.annotation.*;

import java.util.OptionalDouble;
import java.util.UUID;

@RestController
@RequestMapping("test")
@Api(tags = "测试控制器")
public class TestController {

    @ApiOperation("获取测试数据")
    @GetMapping("getTest")
    public ResultVo getTest() {
        return ResultVo.ok("返回测试数据");
    }

    @ApiOperation("添加订单")
    @PostMapping("save")
    public ResultVo save(@RequestBody Order order) {
        System.out.println(order);
        order.setId(UUID.randomUUID().toString());
        return ResultVo.ok(order);
    }
}
